using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._AnalysisTools._Proximity
{
    /// <summary>
    /// <para>Generate Origin-Destination Links</para>
    /// <para>Generates connecting lines from origin features to destination features. This is often referred to as a spider diagram.</para>
    /// <para>生成从起始要素到目标要素的连接线。这通常被称为蜘蛛图。</para>
    /// </summary>    
    [DisplayName("Generate Origin-Destination Links")]
    public class GenerateOriginDestinationLinks : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public GenerateOriginDestinationLinks()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_origin_features">
        /// <para>Origin Features</para>
        /// <para>The input features from which links will be generated.</para>
        /// <para>将从中生成链接的输入要素。</para>
        /// </param>
        /// <param name="_destination_features">
        /// <para>Destination Features</para>
        /// <para>The destination features to which links will be generated.</para>
        /// <para>将生成链接的目标要素。</para>
        /// </param>
        /// <param name="_out_feature_class">
        /// <para>Output Feature Class</para>
        /// <para>The output polyline feature class that will contain the output links.</para>
        /// <para>将包含输出链接的输出折线要素类。</para>
        /// </param>
        public GenerateOriginDestinationLinks(object _origin_features, object _destination_features, object _out_feature_class)
        {
            this._origin_features = _origin_features;
            this._destination_features = _destination_features;
            this._out_feature_class = _out_feature_class;
        }
        public override string ToolboxName => "Analysis Tools";

        public override string ToolName => "Generate Origin-Destination Links";

        public override string CallName => "analysis.GenerateOriginDestinationLinks";

        public override List<string> AcceptEnvironments => ["extent", "scratchWorkspace", "workspace"];

        public override object[] ParameterInfo => [_origin_features, _destination_features, _out_feature_class, _origin_group_field, _destination_group_field, _line_type.GetGPValue(), _num_nearest, _search_distance, _distance_unit.GetGPValue(), _aggregate_links.GetGPValue(), _sum_fields];

        /// <summary>
        /// <para>Origin Features</para>
        /// <para>The input features from which links will be generated.</para>
        /// <para>将从中生成链接的输入要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Origin Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _origin_features { get; set; }


        /// <summary>
        /// <para>Destination Features</para>
        /// <para>The destination features to which links will be generated.</para>
        /// <para>将生成链接的目标要素。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Features")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _destination_features { get; set; }


        /// <summary>
        /// <para>Output Feature Class</para>
        /// <para>The output polyline feature class that will contain the output links.</para>
        /// <para>将包含输出链接的输出折线要素类。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Feature Class")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_feature_class { get; set; }


        /// <summary>
        /// <para>Origin Group Field</para>
        /// <para>The attribute field from the input origin features that will be used for grouping. Features that have the same group field value between origins and destinations will be connected with a link.</para>
        /// <para>输入原点要素中将用于分组的属性字段。在起点和终点之间具有相同组字段值的要素将通过链接进行连接。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Origin Group Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _origin_group_field { get; set; } = null;


        /// <summary>
        /// <para>Destination Group Field</para>
        /// <para>The attribute field from the input destination features that will be used for grouping. Features that have the same group field value between origins and destinations will be connected with a link.</para>
        /// <para>将用于分组的输入目标要素中的属性字段。在起点和终点之间具有相同组字段值的要素将通过链接进行连接。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Destination Group Field")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _destination_group_field { get; set; } = null;


        /// <summary>
        /// <para>Line Type</para>
        /// <para><xdoc>
        ///   <para>Specifies whether a shortest path on a spheroid (geodesic) or a Cartesian projected earth (planar) will be used when generating the output links. Geodesic lines will have a slight curve when their length exceeds approximately 50 kilometers, as the curvature of the Earth makes the shortest distance between two points appear curved when viewed on a 2D map.</para>
        ///   <para>It is recommended that you use the Geodesic line type with data stored in a coordinate system that is not appropriate for distance measurements (for example, Web Mercator and any geographic coordinate system) or any dataset that spans a large geographic area.</para>
        ///   <bulletList>
        ///     <bullet_item>Planar—Planar distance will be used between features. This is the default.</bullet_item><para/>
        ///     <bullet_item>Geodesic—Geodesic distances will be used between features. This line type takes into account the curvature of the spheroid and correctly deals with data near the dateline and poles.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定在生成输出链接时，是使用椭球体（测地线）上的最短路径还是笛卡尔投影地球（平面）上的最短路径。当测地线的长度超过大约 50 公里时，测地线将略有弯曲，因为地球的曲率使两点之间的最短距离在 2D 地图上查看时显示为弯曲。</para>
        ///   <para>建议将测地线类型用于存储在不适合距离测量的坐标系（例如，Web 墨卡托和任何地理坐标系）或跨大地理区域的任何数据集中的数据。</para>
        ///   <bulletList>
        ///     <bullet_item>平面—要素之间将使用平面距离。这是默认设置。</bullet_item><para/>
        ///     <bullet_item>测地线—要素之间将使用测地线距离。这种线类型考虑了椭球体的曲率，并正确处理了日期变更线和极点附近的数据。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Line Type")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _line_type_value _line_type { get; set; } = _line_type_value._PLANAR;

        public enum _line_type_value
        {
            /// <summary>
            /// <para>Planar</para>
            /// <para>Planar—Planar distance will be used between features. This is the default.</para>
            /// <para>平面—要素之间将使用平面距离。这是默认设置。</para>
            /// </summary>
            [Description("Planar")]
            [GPEnumValue("PLANAR")]
            _PLANAR,

            /// <summary>
            /// <para>Geodesic</para>
            /// <para>Geodesic—Geodesic distances will be used between features. This line type takes into account the curvature of the spheroid and correctly deals with data near the dateline and poles.</para>
            /// <para>测地线—要素之间将使用测地线距离。这种线类型考虑了椭球体的曲率，并正确处理了日期变更线和极点附近的数据。</para>
            /// </summary>
            [Description("Geodesic")]
            [GPEnumValue("GEODESIC")]
            _GEODESIC,

        }

        /// <summary>
        /// <para>Number of Nearest Destinations</para>
        /// <para><xdoc>
        ///   <para>The maximum number of links that will be generated per origin feature to the nearest destination features. If no number is specified, the tool will generate links between all origin and destination features.</para>
        ///   <para>For example, using a value of 1 will generate links between each origin feature and its closest destination feature.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>每个源要素将生成到最近目标要素的最大链接数。如果未指定数字，则该工具将在所有起点和终点要素之间生成链接。</para>
        ///   <para>例如，使用值 1 将在每个源要素与其最近的目标要素之间生成链接。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Number of Nearest Destinations")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _num_nearest { get; set; } = null;


        /// <summary>
        /// <para>Search Distance</para>
        /// <para>The maximum distance between an origin and destination feature that will produce a link feature in the output. The unit of the search distance is specified in the distance unit parameter. If no search distance is specified, the tool will generate links between all origin and destination features regardless of their distance apart.</para>
        /// <para>将在输出中生成链接要素的起点要素和目标要素之间的最大距离。搜索距离的单位在距离单位参数中指定。如果未指定搜索距离，则该工具将在所有起点和目标要素之间生成链接，无论它们之间的距离如何。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Search Distance")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public double? _search_distance { get; set; } = null;


        /// <summary>
        /// <para>Distance Unit</para>
        /// <para><xdoc>
        ///   <para>Specifies the units used to measure the length of the links. Distances for each link will appear in the LINK_DIST field. If a distance unit is not specified, the distance unit of the origin features' coordinate system will be used.</para>
        ///   <bulletList>
        ///     <bullet_item>Kilometers—The distance between origin and destination will be calculated in kilometers.</bullet_item><para/>
        ///     <bullet_item>Meters—The distance between origin and destination will be calculated in meters.</bullet_item><para/>
        ///     <bullet_item>Miles—The distance between origin and destination will be calculated in miles.</bullet_item><para/>
        ///     <bullet_item>Nautical miles—The distance between origin and destination will be calculated in nautical miles.</bullet_item><para/>
        ///     <bullet_item>Yards—The distance between origin and destination will be calculated in yards.</bullet_item><para/>
        ///     <bullet_item>Feet—The distance between origin and destination will be calculated in feet.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定用于测量链接长度的单位。每个链接的距离将显示在LINK_DIST字段中。如果未指定距离单位，则将使用原点要素坐标系的距离单位。</para>
        ///   <bulletList>
        ///     <bullet_item>千米—起点和目的地之间的距离将以千米为单位计算。</bullet_item><para/>
        ///     <bullet_item>米—起点和终点之间的距离将以米为单位计算。</bullet_item><para/>
        ///     <bullet_item>英里—始发地和目的地之间的距离将以英里为单位计算。</bullet_item><para/>
        ///     <bullet_item>海里—起点和目的地之间的距离将以海里为单位计算。</bullet_item><para/>
        ///     <bullet_item>码—起点和终点之间的距离将以码为单位计算。</bullet_item><para/>
        ///     <bullet_item>英尺—起点和终点之间的距离将以英尺为单位计算。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Distance Unit")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _distance_unit_value? _distance_unit { get; set; } = null;

        public enum _distance_unit_value
        {
            /// <summary>
            /// <para>Kilometers</para>
            /// <para>Kilometers—The distance between origin and destination will be calculated in kilometers.</para>
            /// <para>千米—起点和目的地之间的距离将以千米为单位计算。</para>
            /// </summary>
            [Description("Kilometers")]
            [GPEnumValue("KILOMETERS")]
            _KILOMETERS,

            /// <summary>
            /// <para>Meters</para>
            /// <para>Meters—The distance between origin and destination will be calculated in meters.</para>
            /// <para>米—起点和终点之间的距离将以米为单位计算。</para>
            /// </summary>
            [Description("Meters")]
            [GPEnumValue("METERS")]
            _METERS,

            /// <summary>
            /// <para>Miles</para>
            /// <para>Miles—The distance between origin and destination will be calculated in miles.</para>
            /// <para>英里—始发地和目的地之间的距离将以英里为单位计算。</para>
            /// </summary>
            [Description("Miles")]
            [GPEnumValue("MILES")]
            _MILES,

            /// <summary>
            /// <para>Nautical miles</para>
            /// <para>Nautical miles—The distance between origin and destination will be calculated in nautical miles.</para>
            /// <para>海里—起点和目的地之间的距离将以海里为单位计算。</para>
            /// </summary>
            [Description("Nautical miles")]
            [GPEnumValue("NAUTICALMILES")]
            _NAUTICALMILES,

            /// <summary>
            /// <para>Yards</para>
            /// <para>Yards—The distance between origin and destination will be calculated in yards.</para>
            /// <para>码—起点和终点之间的距离将以码为单位计算。</para>
            /// </summary>
            [Description("Yards")]
            [GPEnumValue("YARDS")]
            _YARDS,

            /// <summary>
            /// <para>Feet</para>
            /// <para>Feet—The distance between origin and destination will be calculated in feet.</para>
            /// <para>英尺—起点和终点之间的距离将以英尺为单位计算。</para>
            /// </summary>
            [Description("Feet")]
            [GPEnumValue("FEET")]
            _FEET,

        }

        /// <summary>
        /// <para>Aggregate Overlapping Links</para>
        /// <para><xdoc>
        ///   <para>Specifies whether overlapping links will be aggregated.</para>
        ///   <bulletList>
        ///     <bullet_item>Checked—Overlapping links will be aggregated if the starting point coordinates are the same.</bullet_item><para/>
        ///     <bullet_item>Unchecked—Overlapping links will not be aggregated. This is the default.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定是否聚合重叠链接。</para>
        ///   <bulletList>
        ///     <bullet_item>选中 - 如果起点坐标相同，则将聚合重叠链接。</bullet_item><para/>
        ///     <bullet_item>未选中 - 不会聚合重叠链接。这是默认设置。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Aggregate Overlapping Links")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public _aggregate_links_value _aggregate_links { get; set; } = _aggregate_links_value._false;

        public enum _aggregate_links_value
        {
            /// <summary>
            /// <para>AGGREGATE_OVERLAPPING</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("AGGREGATE_OVERLAPPING")]
            [GPEnumValue("true")]
            _true,

            /// <summary>
            /// <para>NO_AGGREGATE</para>
            /// <para></para>
            /// <para></para>
            /// </summary>
            [Description("NO_AGGREGATE")]
            [GPEnumValue("false")]
            _false,

        }

        /// <summary>
        /// <para>Summary Fields</para>
        /// <para><xdoc>
        ///   <para>Specifies the numeric field or fields containing the attribute values that will be used to calculate the specified statistic. Multiple statistic and field combinations can be specified. Null values are excluded from all statistical calculations.</para>
        ///   <para>Text attribute fields can be summarized using first and last statistics. Numeric attribute fields can be summarized using any statistic.</para>
        ///   <para>Available statistics types are as follows:</para>
        ///   <bulletList>
        ///     <bullet_item>Sum—The values for the specified field will be added together.</bullet_item><para/>
        ///     <bullet_item>Mean—The average for the specified field will be calculated.</bullet_item><para/>
        ///     <bullet_item>Minimum—The smallest value for all records of the specified field will be found.</bullet_item><para/>
        ///     <bullet_item>Maximum—The largest value for all records of the specified field will be found.</bullet_item><para/>
        ///     <bullet_item>Range—The range of values (maximum minus minimum) for the specified field will be calculated.</bullet_item><para/>
        ///     <bullet_item>Standard deviation—The standard deviation of values in the specified field will be calculated.</bullet_item><para/>
        ///     <bullet_item>Count—The number of values included in the statistical calculations will be found. Each value will be counted except null values. To determine the number of null values in a field, create a count on the field in question, create a count on a different field that does not contain null values (for example, the OID if present), and subtract the two values.</bullet_item><para/>
        ///     <bullet_item>First—The specified field value of the first record in the input will be used.</bullet_item><para/>
        ///     <bullet_item>Last—The specified field value of the last record in the input will be used.</bullet_item><para/>
        ///     <bullet_item>Median—The median for all records of the specified field will be calculated.</bullet_item><para/>
        ///     <bullet_item>Variance—The variance for all records of the specified field will be calculated.</bullet_item><para/>
        ///     <bullet_item>Unique—The number of unique values of the specified field will be counted.</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>指定包含将用于计算指定统计数据的属性值的一个或多个数值字段。可以指定多个统计量和字段组合。空值从所有统计计算中排除。</para>
        ///   <para>可以使用第一个和最后一个统计信息对文本属性字段进行汇总。可以使用任何统计数据对数值属性字段进行汇总。</para>
        ///   <para>可用的统计信息类型如下：</para>
        ///   <bulletList>
        ///     <bullet_item>Sum—指定字段的值将相加。</bullet_item><para/>
        ///     <bullet_item>均值—将计算指定字段的平均值。</bullet_item><para/>
        ///     <bullet_item>最小值—将找到指定字段的所有记录的最小值。</bullet_item><para/>
        ///     <bullet_item>最大值—将找到指定字段的所有记录的最大值。</bullet_item><para/>
        ///     <bullet_item>范围—将计算指定字段的值范围（最大值减去最小值）。</bullet_item><para/>
        ///     <bullet_item>标准差—将计算指定字段中值的标准差。</bullet_item><para/>
        ///     <bullet_item>计数—将找到统计计算中包含的值数。除 null 值外，将计算每个值。若要确定字段中 null 值的数目，请在相关字段上创建计数，在不包含 null 值的其他字段上创建计数（例如，如果存在 OID），然后减去这两个值。</bullet_item><para/>
        ///     <bullet_item>First - 将使用输入中第一条记录的指定字段值。</bullet_item><para/>
        ///     <bullet_item>最后 - 将使用输入中最后一条记录的指定字段值。</bullet_item><para/>
        ///     <bullet_item>中位数—将计算指定字段的所有记录的中位数。</bullet_item><para/>
        ///     <bullet_item>方差—将计算指定字段的所有记录的方差。</bullet_item><para/>
        ///     <bullet_item>唯一 - 将计算指定字段的唯一值数。</bullet_item><para/>
        ///   </bulletList>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Summary Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public object _sum_fields { get; set; } = null;


        public GenerateOriginDestinationLinks SetEnv(object extent = null, object scratchWorkspace = null, object workspace = null)
        {
            base.SetEnv(extent: extent, scratchWorkspace: scratchWorkspace, workspace: workspace);
            return this;
        }

    }

}